/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author ARELLANO RODRIGUEZ
 */
@Entity
@Table(name = "hardware")
@NamedQueries({
    @NamedQuery(name = "Hardware.findAll", query = "SELECT h FROM Hardware h"),
    @NamedQuery(name = "Hardware.findByCodigoHardware", query = "SELECT h FROM Hardware h WHERE h.codigoHardware = :codigoHardware"),
    @NamedQuery(name = "Hardware.findByDescripcionHardware", query = "SELECT h FROM Hardware h WHERE h.descripcionHardware = :descripcionHardware")})
public class Hardware implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "codigo_hardware")
    private Integer codigoHardware;
    @Size(max = 30)
    @Column(name = "descripcion_hardware")
    private String descripcionHardware;

    public Hardware() {
    }

    public Hardware(Integer codigoHardware) {
        this.codigoHardware = codigoHardware;
    }

    public Integer getCodigoHardware() {
        return codigoHardware;
    }

    public void setCodigoHardware(Integer codigoHardware) {
        this.codigoHardware = codigoHardware;
    }

    public String getDescripcionHardware() {
        return descripcionHardware;
    }

    public void setDescripcionHardware(String descripcionHardware) {
        this.descripcionHardware = descripcionHardware;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codigoHardware != null ? codigoHardware.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Hardware)) {
            return false;
        }
        Hardware other = (Hardware) object;
        if ((this.codigoHardware == null && other.codigoHardware != null) || (this.codigoHardware != null && !this.codigoHardware.equals(other.codigoHardware))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Hardware[ codigoHardware=" + codigoHardware + " ]";
    }
    
}
